﻿// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System;
using System.Globalization;
using System.Text;
using System.Windows.Data;
using Rachmans.Sabang.Tools;

namespace Rachmans.Sabang.Data
{
    public class PageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            quranPagesPage pg = new quranPagesPage();
            int juz = PageHelper.GetJuzFromPage((int)value, out pg);

            return new StringBuilder("Juz ").Append(juz).Append(" - Sura ").Append(pg.sura);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
